don't allocate the popup smaller than the combobox. Fixes bug #59660.
authorMichael Natterer <mitch@gimp.org>
Tue, 11 May 2004 19:15:56 +0000 (19:15 +0000)
committerMichael Natterer <mitch@src.gnome.org>
Tue, 11 May 2004 19:15:56 +0000 (19:15 +0000)
2004-05-11  Michael Natterer  <mitch@gimp.org>

* gtk/gtkcombobox.c (gtk_combo_box_popup)
(gtk_combo_box_menu_button_press): don't allocate the popup
smaller than the combobox. Fixes bug #59660.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c

index ae0c9ca9f7f1e31e42b33b1774c23da2a4010348..296f65b2975039d7e724d58bcc41bdea7e48d23a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-05-11  Michael Natterer  <mitch@gimp.org>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_popup)
+       (gtk_combo_box_menu_button_press): don't allocate the popup
+       smaller than the combobox. Fixes bug #59660.
+
 2004-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
index ae0c9ca9f7f1e31e42b33b1774c23da2a4010348..296f65b2975039d7e724d58bcc41bdea7e48d23a 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-11  Michael Natterer  <mitch@gimp.org>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_popup)
+       (gtk_combo_box_menu_button_press): don't allocate the popup
+       smaller than the combobox. Fixes bug #59660.
+
 2004-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
index ae0c9ca9f7f1e31e42b33b1774c23da2a4010348..296f65b2975039d7e724d58bcc41bdea7e48d23a 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-11  Michael Natterer  <mitch@gimp.org>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_popup)
+       (gtk_combo_box_menu_button_press): don't allocate the popup
+       smaller than the combobox. Fixes bug #59660.
+
 2004-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
index ae0c9ca9f7f1e31e42b33b1774c23da2a4010348..296f65b2975039d7e724d58bcc41bdea7e48d23a 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-11  Michael Natterer  <mitch@gimp.org>
+
+       * gtk/gtkcombobox.c (gtk_combo_box_popup)
+       (gtk_combo_box_menu_button_press): don't allocate the popup
+       smaller than the combobox. Fixes bug #59660.
+
 2004-05-11  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtkuimanager.c (gtk_ui_manager_get_widget): Revert the
index 291c46b18eda45185424f7a6773838f89dd2a7c2..eaca7a968009fe55c532033ea53851b26ff2ca24 100644 (file)
@@ -1170,8 +1170,13 @@ gtk_combo_box_popup (GtkComboBox *combo_box)
 
       if (combo_box->priv->wrap_width == 0)
        {
+          GtkRequisition requisition;
+
          width = GTK_WIDGET (combo_box)->allocation.width;
-         gtk_widget_set_size_request (combo_box->priv->popup_widget, width, -1);
+          gtk_widget_size_request (combo_box->priv->popup_widget, &requisition);
+
+         gtk_widget_set_size_request (combo_box->priv->popup_widget,
+                                       MAX (width, requisition.width), -1);
        }
       
       gtk_menu_popup (GTK_MENU (combo_box->priv->popup_widget),
@@ -1945,7 +1950,6 @@ gtk_combo_box_menu_button_press (GtkWidget      *widget,
                                  gpointer        user_data)
 {
   GtkComboBox *combo_box = GTK_COMBO_BOX (user_data);
-  gint width;
 
   if (! GTK_IS_MENU (combo_box->priv->popup_widget))
     return FALSE;
@@ -1959,8 +1963,14 @@ gtk_combo_box_menu_button_press (GtkWidget      *widget,
 
       if (combo_box->priv->wrap_width == 0)
        {
+          GtkRequisition requisition;
+          gint width;
+
          width = GTK_WIDGET (combo_box)->allocation.width;
-         gtk_widget_set_size_request (combo_box->priv->popup_widget, width, -1);
+          gtk_widget_size_request (combo_box->priv->popup_widget, &requisition);
+
+         gtk_widget_set_size_request (combo_box->priv->popup_widget,
+                                       MAX (width, requisition.width), -1);
        }
 
       gtk_menu_popup (GTK_MENU (combo_box->priv->popup_widget),